<!--
 * Copyright TLR Team, Inc. All Rights Reserved.
-->
<div class="modal fade" id="AlertDeviceModal" tabindex="-1" role="dialog" aria-labelledby="AlertDeviceModalLabel">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                        aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="AlertDeviceModalLabel">
                    <i class="fa fa-bank fa-fw hella-icon-offset"></i>健康仪报警信息
                </h4>
            </div>
            <div class="modal-body">
                <div class="row">
                    <div class="col-lg-12">
                        <table class="table table-bordered table-hover" cellspacing="0" width="100%">
                            <thead class="tlr-table-header">
                                <tr><th>用户姓名</th>
                                    <th>联系电话</th>
                                    <th>设备标识</th>
                                    <th>用户住址</th>
                                    <th>报警地址</th>
                                    <th>报警时间</th>
                                    <th></th>
                                </tr>
                            </thead>
                            <tr ng-repeat-start="item in alertMessageList track by $index" style="cursor:pointer;">
                                <td>{{item.health_user.name}}</td>
                                <td>{{item.health_user.tel}}</td>
                                <td>{{item.health_user.deviceMac}}</td>
                                <td>{{item.health_user.address}}</td>
                                <td>{{item.position}}</td>
                                <td>{{item.time| date:'yyyy-MM-dd HH:mm:ss Z'}}</td>
                                <td><input class="btn btn-default" type="button" value="进行处理" ng-click="onShowRelations(item.code, $index)"></td>
                            </tr>
                            <tr ng-show="showRelationList[$index]" >
                                <td colspan="7">
                                    <div ng-if="!alertRelations">查询中...</div>
                                    <table ng-if="alertRelations && alertRelations.length > 0" ng-repeat="relation in alertRelations" class="table table-bordered table-hover" cellspacing="0" width="100%">
                                        <tr><td colspan="2">名字</td><td colspan="5">{{relation.name}}</td></tr>
                                        <tr><td colspan="2">手机</td><td colspan="5">{{relation.mobile}}</td></tr>
                                        <tr ng-if="relation.address"><td colspan="2">地址</td><td colspan="5">{{relation.address}}</td></tr>
                                        <tr ng-if="relation.email"><td colspan="2">邮件</td><td colspan="5">{{relation.email}}</td></tr>
                                    </table>
                                </td>
                            </tr>
                            <tr ng-repeat-end ng-show="showRelationList[$index]">
                                <td colspan="7">
                                    <div style="display:block;color:red;"><b>处理结果(必填项,否则无法关闭报警.处理完毕后不能修改.)</b></div>
                                    <div style="display:block;">
                                        <textarea style="width:100%;height:100px;" ng-model="item.description"></textarea>
                                    </div>
                                    <div>
                                        <input class="btn btn-default" type="button" value="保存处理结果" ng-click="saveDescription(item.id, item.description)">
                                        <input class="btn btn-default" type="button" style="margin-left:20px;" value="处理完毕关闭报警" ng-click="closeCase(item.id, item.description)">
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>
